﻿using SdmxMl.Multiplexor;

namespace SilcQuest
{
    /// <summary>Helper class for transition between old and mew SMS registry</summary>
    public class SilcGroupInfo
    {
        #region Constants

        public const string ANNOT_TYPE_CATI = "CATI";
        private const string METASET_GMD_STARTER_OLD = "GMD_";
        private const string METASET_GMD_STARTER_NEW = "MS_GMD_";
        private const string AGENCY_OLD = "CH1_SILC";
        private const string AGENCYR_NEW = "CH1";
        public const string SUIVI_MARKER = "SUIVI_";
        public const string TECH_MARKER = "TECH_";
        #endregion

        #region Properties

        public string GmdStarter { get; private set; }
        public string AgencyId { get; private set; }

        #endregion

        #region C'tor

        public SilcGroupInfo()
        {
            GmdStarter = Mux.IsNewSmsRegistry ? METASET_GMD_STARTER_NEW : METASET_GMD_STARTER_OLD;
            AgencyId = Mux.IsNewSmsRegistry ? AGENCYR_NEW : AGENCY_OLD;
        }

        public string FilterMsId(string id)
        {
            return Mux.IsNewSmsRegistry ? id.Substring(3) : id;
        }
        public string PrependMsId(string id)
        {
            return Mux.IsNewSmsRegistry ? "MS_" + id : id;
        }


        #endregion
    }

}
